package com.qf.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.qf.mapper.DtsUserMapper;
import com.qf.mapper.IndexTotalMapper;
import com.qf.pojo.DtsUser;
import com.qf.vo.DayStatis;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private DtsUserMapper userMapper;
    @Autowired
    private IndexTotalMapper indexTotalMapper;

    @Override
    public int countUser() {
        QueryWrapper<DtsUser> queryWrapper = new QueryWrapper<>();
        queryWrapper.in("deleted",false);
        Integer count = userMapper.selectCount(queryWrapper);
        return count;
    }

    @Override
    public List<DayStatis> userCnts() {
        List<DayStatis> list = indexTotalMapper.userCnts();
        return list;
    }

    //查找nickname
    @Override
    public List<DtsUser> listUs() {
        List<DtsUser> dtsUsers = userMapper.listUser();
        return dtsUsers;
    }
}
